package com.example.springcloudstream.comsumer;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.function.Consumer;

@Component
public class ConsumerTest {

    @Bean
    public Consumer<String> uppercase() {
        return message -> {
            System.out.println("接受到消息：" + message);
            try {
                Thread.sleep(10000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("消费完毕！");
        };
    }


}
